<div class="comment" id="comment-${_comment.id}">
    #{if flash.commentId !=null && _comment.id.compareTo(new java.lang.Long(flash.commentId)) == 0}
        #{commentMessages/}
    #{/if}
    <a href="@{Users.view(_comment.owner.userName)}" title="View ${_comment.owner.userName}´s profile">
        #{gravatar.img _comment.owner.email, size:50, default:'mm', secure:request.secure/}
    </a>
    <div class="data">
        <div class="header">
            <span class="author">
                <i class="icon-comment"></i> #{user _comment.owner /} <span class="small">commented</span>
            </span>
            <span class="date"><a href="#comment-${_comment.id}">${_comment.date.sinceInUserTZ(true)}</a></span>
            #{if _starRating}
                #{starRating 
                    user:_comment.owner, 
                    rating:_module.getRatingFor(_comment.owner)?.mark /}
            #{/if}
        </div>
        <div class="text" id="comment-${_comment.id}-view">
            #{if _user != null && (_user.isAdmin || _comment.owner == _user)}
                #{form _deleteAction(_comment.id), class:"form-no-margin inline"}
                    <button type="submit" class="btn btn-danger btn-mini action"
                            title="Delete this comment"><i class="icon-trash icon-white"></i> Delete</button>
                #{/form}
                <a href="#" onclick="jQuery('#comment-${_comment.id}-edit, #comment-${_comment.id}-view').toggle(); return false;"
                   title="Edit this comment" class="btn btn-mini action"><i class="icon-edit"></i> Edit</a>
            #{/if}
            ${_comment.text.md()}
        </div>
        <div class="text" id="comment-${_comment.id}-edit" style="display:none;">
            #{if _user != null && (_user.isAdmin || _comment.owner == _user)}
                #{form _editAction(_comment.id)}
                    <textarea name="text" rows="5" maxlength="${util.Util.TEXT_SIZE}">${_comment.text}</textarea>
                    <a href="#" onclick="jQuery('#comment-${_comment.id}-edit, #comment-${_comment.id}-view').toggle(); return false;"
                       class="btn" title="Abort!">Cancel</a>
                    <button class="btn btn-primary" type="submit"
                        title="Save this comment"><i class="icon-ok icon-white"></i> Save</button>
                #{/form}
            #{/if}
        </div>
    </div>
</div>
